package com.yuyou.tas.lesson.mapper;

import com.yuyou.tas.service.api.lesson.dto.DtoBaseSection;
import com.yuyou.tas.service.api.lesson.entity.BaseSection;
import com.yuyou.tas.util.bean.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface BaseSectionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(BaseSection record);

    BaseSection selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(BaseSection record);

    int findSectionCount(Pagination<DtoBaseSection> queryPgn);

    List<DtoBaseSection> findSectionPageList(Pagination<DtoBaseSection> queryPgn);

    BaseSection selectByPKandOrgan(@Param(value="id") Long id, @Param(value="authOrganizationId") Long authOrganizationId);
    
    BaseSection selectByCode7Organ(@Param(value="code") String code, @Param(value="authOrganizationId") Long authOrganizationId);

    List<BaseSection> findSections(Map<String, Object> map);

    Long findMaxCode(Map<String , Object> condition);

    List<BaseSection> findSectionName(Map<String , Object> condition);

    List<Long> findByIds(Map<String , Object> condition);

    List<BaseSection> findBaseSectionByIds(@Param(value="ids")List<Long> ids);

    List<BaseSection> findBaseSectionFromClass(@Param(value="userId")Long userId);
    
    /**
     * 获取所有年级
     * @return
     */
    List<BaseSection> findAllBaseSection();
}